<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8"/>
        <title>测试</title>
        <style>
            .first {
                width: 400px;
                height: 200px;
                background-color: red;
                margin:0 auto;
                padding-top:30px;
            }
            .second {
                width: 200px;
                height: 150px;
                background-color: blue;
                margin:0 auto;
            }
            .third {
                width: 160px;
                height: 80px;
                background-color: yellow;
            }
        </style>
    </head>
    <body>
        <div class="first">
            <div class="second">
                <div class="third"></div>
            </div>
        </div>
    </body>
</html>